<template>
	<div class="index">
		<index-top></index-top>
		<index-main></index-main>
	</div>
</template>

<script>

	import Top from "./Top";
	import Main from "./Main";

	export default {
		name: "index.vue",
		components: {
			'index-top': Top,
			'index-main': Main
		},
		created() {
			let username=this.$cookie.get('username');
			if(username==null){
				this.$message({
					type:"error",
					message: '请先登录'
				});
				this.$router.push({
					path: '/'
				})
			}
		}

	}
</script>

<style >
	.index{
		margin: 0;
		padding: 0;
		display: flex;
		flex-direction: column;
		height: 100vh
	}
</style>
